<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>用户协议管理</title>
	<meta name="decorator" content="default"/>
	<link rel="stylesheet" type="text/css" href="${ctxStatic }/fuwenben/styles/simditor.css" />
	
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/jiujiudevice/jiuUserAgree/form?id=${jiuUserAgree.id}">用户协议<shiro:hasPermission name="jiujiudevice:jiuUserAgree:edit">${not empty jiuUserAgree.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="jiujiudevice:jiuUserAgree:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="jiuUserAgree" action="${ctx}/jiujiudevice/jiuUserAgree/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">内容:</label>
			<div class="controls">
				<textarea id="editor" name="content" placeholder="请输入内容..." autofocus>
					${jiuUserAgree.content }
				</textarea>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="jiujiudevice:jiuUserAgree:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
		<script type="text/javascript" src="${ctxStatic }/fuwenben/scripts/jquery.min.js"></script>
	<script type="text/javascript" src="${ctxStatic }/fuwenben/scripts/module.js"></script>
	<script type="text/javascript" src="${ctxStatic }/fuwenben/scripts/hotkeys.js"></script>
	<script type="text/javascript" src="${ctxStatic }/fuwenben/scripts/uploader.js"></script>
	<script type="text/javascript" src="${ctxStatic }/fuwenben/scripts/simditor.js"></script>
		<script type="text/javascript">
		
	        Simditor.locale = 'zh-CN';//设置中文
	        var editor = new Simditor({
	            textarea: $('#editor'),  //textarea的id
	            placeholder: '这里输入文字...',
	            toolbar:  ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', 'alignment'], //工具条都包含哪些内容
	            pasteImage: true,//允许粘贴图片
	            upload : {
	                url : '${ctxFront}/jiujiudevice/fileUpload/up', //文件上传的接口地址
	                params: null, //键值对,指定文件上传接口的额外参数,上传的时候随文件一起提交
	                fileKey: 'file', //服务器端获取文件数据的参数名
	                connectionCount: 3,
	                leaveConfirm: '正在上传文件'
	            }
	        });		  
	</script>
</body>
</html>
